<?
$nik 	= $HTTP_GET_VARS['nik']; 
$nama 	= $HTTP_GET_VARS['nama'];
$no		= $HTTP_GET_VARS['no'];
?>
<link rel="stylesheet" type="text/css" href="../style/style.css" />
<script language="javascript">
function exit(Str,Nn)
{
		var namax = document.forms[Str].elements[0].value;
		var hubunganx = document.forms[Str].elements[1].value;

		if (!opener.closed)
		{
			opener.document.forms['FEmployee'].nama_tertanggung<?=$no?>.value = namax;
			opener.document.forms['FEmployee'].status_keluarga<?=$no?>.value = hubunganx;
			close();
		}
}
</script>
<?
include("../lib/config.php");
echo"
<center><b>
Daftar Keluarga dari: $nama
</center>
";
$sql = mssql_query("SELECT ROW_NUMBER() OVER (ORDER BY Nm_Keluarga) AS No, Nm_Keluarga, B.nama FROM Keluarga A, VHubKel B WHERE NIK='$nik' AND A.Hubungan=B.kode AND Hubungan IN ('5','3')",$conn);
?>
<table align="center">
 <tr class="headlist">
  <td>No.</td>
  <td>Nama</td>
  <td>Hubungan</td>
  <td>&nbsp;</td>
 </tr>
<?
while($row = mssql_fetch_array($sql)){
	echo"
	<form name='form$row[No]' >
	<tr class=contentlist>
	 <td>$row[No]</td>
	 <td>$row[Nm_Keluarga] <input type='hidden' name='nama".$row[No]."' value='$row[Nm_Keluarga]'></td>
	 <td>$row[nama] <input type='hidden' name='hubungan".$row[No]."' value='$row[nama]'></td>
	 <td><input type='button' value='&radic; pilih' onclick=\"Javascript:exit('form".$row[No]."','n".$row[No]."');\"></td>
	</tr>
	</form>
	";
}
?>
</table>
<br>
<center>
<input type="button" value="Tutup" class="button" onClick="Javascript:window.close();">
</center>